#include <stdio.h>
#include<string.h>

int main()
{
    char str[101];
    char str_copy[101];
    gets(str);
    int len = strlen(str);
    int p = 0;
    for(p = 0; p < len; p++){
        str_copy[p] = 'a';
    }
    str_copy[len] = '\0';
    int i = 0;
    int j = len - 1;
    while(str[i] != '\0'){
        if ((str[i] <= 'z' && str[i] >= 'a') || (str[i] <= 'Z' && str[i] >= 'A')){
            while(str_copy[j] == '%' || str_copy[j] == '$' || str_copy[j] == ' '){
                j--;
            }
            while (str[j] == '%' || str[j] == '$' || str[j] == ' ')
            {
                str_copy[j] = str[j--];
            }

            str_copy[j--] = str[i++];
        }else if(str[i] == '%' || str[i] == '$' || str[i] == ' '){
            str_copy[i] = str[i];
            i++;
        }else{
            printf("error");
            return 0;
        }
    }
    puts(str_copy);
    return 0;
}